<?php

class FolhaPonto extends Zend_Db_Table_Abstract
{

    protected $_name = 'folha_ponto';

    public static function getHoras($where = null, $order = null)
    {
        $db        = Zend_Db_Table::getDefaultAdapter();
        $cols      = array('f.*','u.nome');
        $folha     = array('f' => 'folha_ponto');
        $usuario   = array('u' => 'usuario');
        
        $select = $db->select()
                     ->from($folha, $cols)
                     ->join($usuario, 'u.id = f.user_id');
        if($where){$select->where($where);}
        if($order){$select->order($order);}

        $result = $db->fetchAll($select);
        
        return $result;
        
    }


}

